#include"initOpenGL.h"

//scene object
Camera    myCamera;
Box       myBox;
Particles myParticles;

//physics parameters
Vector   GRAVITATION;
Vector   WIND;
double   DRAGCOEF;
double   TIME;
double   FINISH_TIME;
double   STEPSIZE;

//camera rotation from keyboard input
double   thetaX;
double   thetaY;
double   thetaZ;

int main( int argc , char** argv ) {

    /***** create scene *****/
    //set initial camera parameters
    Vector cam_pos , view , up;
    SETVECTOR( cam_pos , 50 , 50 , 80 )
    SETVECTOR(    view ,   0 , 0 ,   0 )
    SETVECTOR(      up ,   0 , 1 ,   0 )
    setCamera( myCamera , cam_pos , view , up );

    // create box
    Vector box_center;
    SETVECTOR( box_center , 0 , 0 , 0 );
    double box_size    = 50;
    double hole_radius =  10;
    setBox( myBox , box_size , hole_radius );

    // create particles
    double particle_mass   = 10;
    int    particle_radius =  5;
    int    particle_num    = 30;
    setParticles( myParticles , particle_mass , particle_radius , particle_num );

    /***** set Physics coefficient *****/
    SETVECTOR( GRAVITATION , 0.0 , -9.8 , 0.0 )
    SETVECTOR( WIND , 0.0 ,  0.0 , 0.0 )
    DRAGCOEF     = -0.5;
    TIME         =    0;
    FINISH_TIME  = 100000;
    STEPSIZE     = 0.005;

    /***** registered callback functions *****/
    init_OpenGL( argc , argv );
    glutIdleFunc(idle);
	glutDisplayFunc(display);
	glutReshapeFunc(reshape);
	glutKeyboardFunc(keyboard);
	glutMainLoop();

    return 0;
}
